package com.zjw.demo.vertx.starter.template.sqlmapping;

import com.zjw.demo.vertx.starter.plugin.impl.database.SQL;
import com.zjw.demo.vertx.starter.plugin.impl.database.SQLMapping;
import com.zjw.demo.vertx.starter.plugin.impl.database.SQLParams;
import com.zjw.demo.vertx.starter.smi.IFutureTask;
import com.zjw.demo.vertx.starter.template.bean.User;

import java.util.List;

@SQLMapping
public interface DemoSqlMapping {


  @SQL(value = "SELECT * FROM user WHERE 1=1 AND username=:username")
  void queryUserById(IFutureTask<List<User>> call, @SQLParams("username") String username);

  @SQL(value = "SELECT * FROM user WHERE 1=1")
  void queryAllUser(IFutureTask<List<User>> call);

  @SQL("INSERT INTO user (username,password) VALUES(:username,:password)")
  void insertUser(IFutureTask<List<User>> call, @SQLParams("username") String username, @SQLParams("password") String password);
}
